<style>
	.editTable .label {
		min-width: 80px;
		width: 80px;
	}

	.depInputClass {
		border: 1px solid #ffa8a8;
		background-color: #fff3f3;
	}

</style>
<form id="editForm" method="post">
	<input type="hidden" name="id" id="id">
	<table class="editTable">
		<tr>
			<td class="label">权限菜单名称</td>
			<td><input type="text" name="funcName" class="topjui-textbox"
			           data-options="required:true,validType:'length[1,30]'"
			           style="width: 200px;">
			</td>
			<td class="label">排序值</td>
			<td>
				<input type="text" name="sort" class="topjui-numberbox" data-options="required:true"
				       style="width: 200px;">
			</td>
		</tr>
		<tr>
			<td class="label">上级分类</td>
			<td><input type="hidden" name="parentID" id="parentIdHidden" value="0"/>
				<select id="parentId" style="width: 200px;height: 35px;">

				</select>
			</td>
			<td class="label">权限类型</td>
			<td>
				<select id="funcType" name="funcType" style="width: 200px;height: 35px;">
					<option value="1">主菜单</option>
					<option value="2">右键命令菜单</option>
					<option value="3">地图工具</option>
					<option value="4">终端命令工具栏</option>
				</select>
			</td>
		</tr>
		<tr>
			<td class="label">URL地址</td>
			<td><input type="text" name="url" class="topjui-textbox"
			           style="width: 200px;">
			</td>
			<td class="label">权限编码</td>
			<td>
				<input type="text" name="name" class="topjui-textbox"
				       style="width: 200px;"> (慎重修改)
			</td>
		</tr>
		<tr>
			<td class="label">菜单图标CSS</td>
			<td colspan="3">
				<input type="text" name="iconCls" class="topjui-textbox"
				       style="width: 200px;"> (web端图标中的css风格)
			</td>
		</tr>
	</table>
</form>

<script type="text/javascript">
	$(function () {

		$.post(path + "/funcConfig/loadRootMenus", function (data) {
			$("#parentId").append("<option value='0'></option>");
			$.each(data, function (i, item) {
				$("#parentId").append("<option value='" + item.id + "'>" + item.funcName + "</option>");//新增
			});
			var parentIdHidden = $("#parentIdHidden").val();
			if (parentIdHidden != '') {
				$("#parentId option[value='" + parentIdHidden + "']").attr("selected", true);
			}
		});

		$("#parentId").change(function () {
			$("#parentIdHidden").val($("#parentId option:selected").val());
		});

		var funcType = $("#funcType").val();
		if (funcType != '') {
			$("#funcType option[value='" + funcType + "']").attr("selected", true);
		}
	})


</script>

